<div class='container-fluid'>
  <div class="row">
      <div class="col-lg-12">
          <h1 class="page-header">Customer</h1>
      </div>
  </div>
  <form role="form" accept-charset="UTF-8" action="/admin/customer/{{ customer.id }}" method="POST">
    <div class='row'>
      <div class="col-lg-6">
        <div class="form-group">
          <label>Phone</label>
          <input class="form-control" placeholder="input phone" name="phone"  disabled value="{{ customer.phone }}">
        </div>

        <div class="form-group">
          <label>Remaining Traffic </label>
          <input class="form-control" placeholder="input remainingTraffic " disabled name="remainingTraffic  " value="{{ customer.remainingTraffic   }}">
        </div>

        <div class="form-group">
          <label>用户等级</label>
          {{ selectTag levelOptions levelCollection customer.levelId }}
        </div>
      </div>
      <div class="col-lg-6">
        <div class="form-group">
          <label>User name</label>
          <input class="form-control" placeholder="input username" name="username"  disabled value="{{ customer.username }}">
        </div>

        <div class="form-group">
          <div class="col-lg-6">
            <label>wechat</label>
            <input class="form-control" placeholder="input wechat" name="wechat"  disabled value="{{ customer.wechat }}">
          </div>
          <div class="col-lg-6">
            <div class="checkbox" style="padding-top: 20px;">
              <label>
                  <input type="checkbox" name="allowGiven" {{ isChecked customer.allowGiven  }} >允许转赠
              </label>
            </div>
          </div>
        </div>

        <div class="form-group">
          <label>Last login</label>
          <input class="form-control" placeholder="input last login" name="lastLoginAt"  disabled value="{{ strftime customer.lastLoginAt 'YYYY-MM-DD' }}">
        </div>

      </div>
    </div>

    <div class="row">

      <div class="col-lg-3">
        <a href="/admin/flowhistories?customerId={{customer.id}}&state=1">
          <button class="btn btn-info">收入</button>
        </a>
      </div>
      <div class="col-lg-3">
        <a href="/admin/flowhistories?customerId={{customer.id}}&state=0">
          <button class="btn btn-info">支出</button>
        </a>
      </div>
    </div>
    <hr>
    <div class="row">
      <div class="col-lg-11">
        <button type="submit" class="pull-right btn btn-primary">提  交</button>
      </div>
    </div>
  </form>
</div>
<hr>
<div class='container-fluid'>
  <div class="row">
    <div class="col-lg-6">
      <form role="form" accept-charset="UTF-8" action="/admin/customer/traffic/{{ customer.id }}" method="POST">
        <input type='hidden' name="type" value='1'>
        <div class="form-group">
          <label>增加余额</label>
          <input class="form-control" name="num">
        </div>
        <div class="form-group">
          <label>记录</label>
          <textarea class="form-control" id="comment" name="comment" rows="3"></textarea>
        </div>
        <div class="form-group">
          <button type="submit" class="pull-right btn btn-primary">提  交</button>
        </div>
      </form>
    </div>
    <div class="col-lg-6">
      <form role="form" accept-charset="UTF-8" action="/admin/customer/traffic/{{ customer.id }}" method="POST">
        <input type='hidden' name="type" value='0'>
        <div class="form-group">
          <label>减少余额</label>
          <input class="form-control" name="num">
        </div>
        <div class="form-group">
          <label>记录</label>
          <textarea class="form-control" id="comment" name="comment" rows="3"></textarea>
        </div>
        <div class="form-group">
          <button type="submit" class="pull-right btn btn-primary">提  交</button>
        </div>
      </form>
    </div>
  </div>
</div>